package top.tangyh.lamp.care.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import top.tangyh.basic.base.mapper.SuperMapper;
import top.tangyh.lamp.care.entity.BCareIsbarAPg;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.List;

/**
 * <p>
 * Mapper 接口
 * Isbar交班单A评估和班次详情表
 * </p>
 *
 * @author zqb
 * @date 2024-08-12 10:28:25
 * @create [2024-08-12 10:28:25] [zqb] [代码生成器生成]
 */
@Repository
public interface BCareIsbarAPgMapper extends SuperMapper<BCareIsbarAPg> {

    /**
     * 根据明细的id集合查找
     *
     * @param ids
     * @return
     */
    default List<BCareIsbarAPg> selectListByDetailIds(Collection<Long> ids) {
        LambdaQueryWrapper<BCareIsbarAPg> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.in(BCareIsbarAPg::getDetailId, ids);
        return this.selectList(queryWrapper);
    }

    /**
     * 根据明细id集合删除
     *
     * @param ids
     */
    default void deleteByDetailIdList(Collection<Long> ids) {
        LambdaQueryWrapper<BCareIsbarAPg> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.in(BCareIsbarAPg::getDetailId, ids);
        this.delete(queryWrapper);
    }


}


